﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true" CodeFile="AssignItems.aspx.cs" Inherits="Items_AssignItems" Title="Продукти към Контрагенти" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        Вид контрагент:
            <cc1:TabContainer ID="TabContainerCompanies" runat="server" ActiveTabIndex="0" 
                Width="50%">
                <cc1:TabPanel ID="TabPanelClients" runat="server" HeaderText="Клиенти"><HeaderTemplate>Клиенти</HeaderTemplate>
                    <ContentTemplate>
                        <telerik:RadGrid ID="RadGridCustomers" runat="server" AutoGenerateColumns="False" 
                            DataSourceID="SqlDataSourceCustomers" GridLines="None" 
                            AllowMultiRowSelection="True">
                            <MasterTableView DataKeyNames="CustomerID" 
                                DataSourceID="SqlDataSourceCustomers">
                                <RowIndicatorColumn>
                                    <HeaderStyle Width="20px" />
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn>
                                    <HeaderStyle Width="20px" />
                                </ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" />
                                    <telerik:GridBoundColumn DataField="Name" 
                                        HeaderText="Име на клиент:" SortExpression="Name" 
                                        UniqueName="Name">
                                    </telerik:GridBoundColumn>
                                </Columns>
                            </MasterTableView>
                            <ClientSettings>
                                <Selecting AllowRowSelect="True" />
                            </ClientSettings>
                            <FilterMenu EnableTheming="True">
                                <CollapseAnimation Duration="200" Type="OutQuint" />
                            </FilterMenu>
                            <HeaderContextMenu EnableTheming="True">
                                <CollapseAnimation Duration="200" Type="OutQuint" />
                            </HeaderContextMenu>
                        </telerik:RadGrid>
                    </ContentTemplate>
                </cc1:TabPanel>
                <cc1:TabPanel ID="TabPanelSuppliers" runat="server" HeaderText="Доставчици">
                    <HeaderTemplate>
                        Доставчици
                    </HeaderTemplate>
                    <ContentTemplate>
                    <telerik:RadGrid ID="RadGridSuppliers" runat="server" 
                        AllowMultiRowSelection="True" AutoGenerateColumns="False" 
                        DataSourceID="SqlDataSourceSuppliers" GridLines="None">
                        <ClientSettings>
                            <Selecting AllowRowSelect="True" />
                        </ClientSettings>
                        <MasterTableView DataKeyNames="SupplierID" 
                            DataSourceID="SqlDataSourceSuppliers">
                            <RowIndicatorColumn>
                                <HeaderStyle Width="20px" />
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn>
                                <HeaderStyle Width="20px" />
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" />
                                <telerik:GridBoundColumn DataField="Name" HeaderText="Име на Доставчик" 
                                    SortExpression="Name" UniqueName="Name">
                                </telerik:GridBoundColumn>
                            </Columns>
                        </MasterTableView>
                        <FilterMenu EnableTheming="True">
                            <CollapseAnimation Duration="200" Type="OutQuint" />
                        </FilterMenu>
                        <HeaderContextMenu EnableTheming="True">
                            <CollapseAnimation Duration="200" Type="OutQuint" />
                        </HeaderContextMenu>
                    </telerik:RadGrid>
                    </ContentTemplate></cc1:TabPanel>
            </cc1:TabContainer>
            <br />
            Вид Продукт:<br />
            <cc1:TabContainer ID="TabContainerItems" runat="server" ActiveTabIndex="0"  
                Width="50%">
                <cc1:TabPanel ID="TabPanelLegs" runat="server" HeaderText="Крака"><HeaderTemplate>Крака</HeaderTemplate>
                    <ContentTemplate>
                        <telerik:RadGrid ID="RadGridLegs" runat="server" AllowMultiRowSelection="True" 
                            AutoGenerateColumns="False" DataSourceID="SqlDataSourceLegs" GridLines="None" >
                            <MasterTableView DataKeyNames="LegID" DataSourceID="SqlDataSourceLegs">
                                <RowIndicatorColumn>
                                    <HeaderStyle Width="20px" />
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn>
                                    <HeaderStyle Width="20px" />
                                </ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" />
                                    <telerik:GridBoundColumn DataField="Code" HeaderText="Код на продукта" 
                                        SortExpression="Code" UniqueName="Code">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="NameBG" HeaderText="Име на продукта" 
                                        SortExpression="NameBG" UniqueName="NameBG">
                                    </telerik:GridBoundColumn>
                                </Columns>
                            </MasterTableView>
                            <ClientSettings>
                                <Selecting AllowRowSelect="True" />
                            </ClientSettings>
                            <FilterMenu EnableTheming="True">
                                <CollapseAnimation Duration="200" Type="OutQuint" />
                            </FilterMenu>
                            <HeaderContextMenu EnableTheming="True">
                                <CollapseAnimation Duration="200" Type="OutQuint" />
                            </HeaderContextMenu>
                        </telerik:RadGrid>
                    </ContentTemplate>
                </cc1:TabPanel>
                <cc1:TabPanel ID="TabPanelCovers" runat="server" HeaderText="Калъфи">
                    <HeaderTemplate>
                        Калъфи
                    </HeaderTemplate>
                    <ContentTemplate>
                        <telerik:RadGrid ID="RadGridCovers" runat="server" 
                            AllowMultiRowSelection="True" AutoGenerateColumns="False" 
                            DataSourceID="SqlDataSourceCovers" GridLines="None">
                            <HeaderContextMenu EnableTheming="True">
                                <CollapseAnimation Duration="200" Type="OutQuint" />
                            </HeaderContextMenu>
                            <MasterTableView DataKeyNames="CoverID" DataSourceID="SqlDataSourceCovers">
                                <RowIndicatorColumn>
                                    <HeaderStyle Width="20px" />
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn>
                                    <HeaderStyle Width="20px" />
                                </ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" />
                                    <telerik:GridBoundColumn DataField="Code" HeaderText="Код" 
                                        SortExpression="Code" UniqueName="Code">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="NameBG" HeaderText="Име на Калъф" 
                                        SortExpression="NameBG" UniqueName="NameBG">
                                    </telerik:GridBoundColumn>
                                </Columns>
                            </MasterTableView>
                            <ClientSettings>
                                <Selecting AllowRowSelect="True" />
                            </ClientSettings>
                            <FilterMenu EnableTheming="True">
                                <CollapseAnimation Duration="200" Type="OutQuint" />
                            </FilterMenu>
                        </telerik:RadGrid>
                    </ContentTemplate>
                </cc1:TabPanel>
            </cc1:TabContainer>
                                             
                                    
            <br />
            <asp:LinkButton ID="lbAssignItems" runat="server" onclick="lbAssignItems_Click">Добавяне на Продуктите към Контрагентите</asp:LinkButton>
            <asp:SqlDataSource ID="SqlDataSourceSuppliers" runat="server" 
                ConnectionString="<%$ ConnectionStrings:icodebg_konturConnectionString %>" 
                SelectCommand="SELECT [SupplierID], [Name] FROM [Suppliers]">
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="SqlDataSourceCustomers" runat="server" 
                ConnectionString="<%$ ConnectionStrings:KonturConnectionString %>" 
                SelectCommand="SELECT [CustomerID], [Name] FROM [Customers]">
            </asp:SqlDataSource>
            
            <asp:SqlDataSource ID="SqlDataSourceLegs" runat="server" 
                ConnectionString="<%$ ConnectionStrings:icodebg_konturConnectionString %>" 
                SelectCommand="SELECT [LegID], [Code], [NameBG] FROM [Legs]">
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="SqlDataSourceCovers" runat="server" 
                ConnectionString="<%$ ConnectionStrings:icodebg_konturConnectionString %>" 
                SelectCommand="SELECT [CoverID], [Code], [NameBG] FROM [Covers]">
            </asp:SqlDataSource>
            <br />
            
            <br />
            
                <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

